$(function(){

  module("Core");

   test("translator.plugin(...)", function () {
    translator.plugin("testplugin", {      
      method : function () {return true;}
    });
    ok(translator.testplugin(), "check if reference to method is added to translator object");
    ok("testplugin" in translator.plugins, "");
  });

test("translator.languages.find(\"en\")", function() {
      var en_expected = {name:"ENGLISH", code:"en", direction:"LTR", charset:"UTF8"};
      same(translator.languages.find("en"), en_expected, "check if what is expected is returned");
      same(translator.languages.list[ translator.languages.cache["en"] ], en_expected, "check if query was cached");
    });
  
test("translator.languages.find(\"engLish\")", function() {
      var en_expected = {name:"ENGLISH", code:"en", direction:"LTR", charset:"UTF8"}; 
      same(translator.languages.find("engLish"), en_expected, "check if what is expected is returned");
      same(translator.languages.list[ translator.languages.cache["engLish"] ], en_expected, "check if query was cached");
});

test("translator.getServices({type:\"*\"})", function () {
    var services = translator.getServices({type: "*"});
    
    ok(services instanceof Array, "checking if it returns an array");
    ok(services.length > 0, "array is populated");
    
    var highest = 0;
    
    services.forEach(function (service) {
      if (service.meta.rating > highest) highest = service.meta.rating;
      ok(!service.meta.disabled, service.meta.shortName +" is not disabled");
    });
    
    same(services[0].meta.rating, highest, "services appear to be sorted by rating");
});


});



